package persistent.impl;

import java.util.List;

import basic.HibBaseDAO;
import model.TCheckReportItem;
import persistent.dao.ICheckReoprtItemDAO;

public class CheckReportItemDAOImpl implements ICheckReoprtItemDAO {
	private HibBaseDAO dao = new HibBaseDAO();
	
	@Override
	public List<TCheckReportItem> getCheckReportItemsByCheckID(int checkid) {
		String hql = "from TCheckReportItem where checkid = ? order by sortnum asc";
		Object para[] = {checkid};
		return dao.select(hql, para);
	}

	@Override
	public TCheckReportItem getCheckReportItem(int itemid) {
		return (TCheckReportItem)dao.findById(TCheckReportItem.class,itemid);
	}

	@Override
	public boolean addReportItem(TCheckReportItem obj) {
		if(dao.insert(obj)>0)
			return true;
		else
			return false;
	}

}
